package com.ljf.common.utils;

import java.util.Collection;

/**
 * 集合工具类
 *
 * @author LJF
 * @since 2024-02-08
 */
public class CollectionUtil {

    private CollectionUtil() {

    }

    /**
     * 判断集合是否不为空
     *
     * @param collection
     * @return
     */
    public static <E> boolean isNotEmpty(Collection<E> collection) {
        return !isEmpty(collection);
    }

    /**
     * 判断集合是否为空
     *
     * @param collection
     * @return
     */
    public static <E> boolean isEmpty(Collection<E> collection) {
        if (collection == null || collection.isEmpty()) {
            return true;
        }
        return false;
    }

}
